<!DOCTYPE html>
<html lang="{{ site.lang | default: "zh-CN" }}"> <!-- 建议将默认语言改为中文 "zh-CN" -->
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

{% seo %}
    <!-- Google Fonts 链接 -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Lora:wght@400;700&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
    <!--[if lt IE 9]>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
    <![endif]-->
    {% include head-custom.html %}

    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-VDMTY87FV1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-VDMTY87FV1');
    </script>

  </head>
  <body>
    <div class="wrapper">
      <!-- 页眉 (header) 内容 -->
      <header class="page-header" role="banner">
        <div class="header-main">
          <img src="{{ '/assets/images/TSLOGO.png' | relative_url }}" alt="天算AI Logo" class="header-logo">
          <h1 class="project-name">天算AI (Natural Algorithm)</h1>
        </div>
        <nav class="nav-container">
          <!-- 左侧导航 -->
          <div class="nav-left">
            <a href="{{ '/' | relative_url }}" class="btn">首页</a>
            <a href="{{ '/blog/' | relative_url }}" class="btn">博客</a>
            <span class="nav-separator">|</span>
            <a href="https://huggingface.co/jinv2" class="btn" target="_blank" rel="noopener noreferrer">Hugging Face</a>
            {% if site.github.is_project_page %}
              <a href="{{ site.github.repository_url }}" class="btn">GitHub</a>
            {% endif %}
          </div>

          <!-- 右侧导航 -->
          <div class="nav-right">
            <a href="https://www.youtube.com/@jinvjinvbar" class="btn" target="_blank" rel="noopener noreferrer">YouTube</a>
            <a href="https://www.tiktok.com/@jinvjinvbar" class="btn" target="_blank" rel="noopener noreferrer">TikTok</a>
            <span class="nav-separator">|</span>
            <a href="{{ '/about/' | relative_url }}" class="btn">关于</a>
            <a href="{{ '/contact/' | relative_url }}" class="btn">联系我们</a>
            {% if site.show_downloads %}
               <span class="nav-separator">|</span>
               <a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
               <a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
            {% endif %}
          </div>
        </nav>
      </header>

      <!-- 主要内容区域 (main) -->
      <main id="content" class="main-content" role="main">

        {{ content }}  <!-- 主要页面/文章内容会显示在这里 -->

        <!-- ======================================================= -->
        <!-- ===== V V V  最新博客文章 & 底部导航 开始 V V V ===== -->
        <!-- ======================================================= -->

        <hr style="margin-top: 2.5rem; margin-bottom: 1.5rem;"> <!-- 顶部 分隔线 -->

        <section class="recent-blog-posts" style="margin-bottom: 1rem;"> <!-- 最新博客文章区域 -->
          <h2 style="margin-bottom: 1rem; font-size: 1.5em; text-align: center;">最新博客文章</h2> <!-- 居中标题 -->
          <ul style="list-style: none; padding-left: 0; text-align: center;"> <!-- 居中列表项 -->
            {% assign post_limit = 5 %} <!-- 设置显示最近文章的数量 -->
            {% for post in site.posts limit:post_limit %} <!-- 获取最新的 'post_limit' 篇文章 -->
                <li style="margin-bottom: 0.5rem;">
                  <a href="{{ post.url | relative_url }}">{{ post.title }}</a> - <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time>
                </li>
            {% endfor %} <!-- 结束循环 -->
          </ul>
        </section>

        <p style="text-align: center; margin-bottom: 1.5rem;"> <!-- 查看所有文章链接 -->
          <a href="{{ '/blog/' | relative_url }}">查看所有文章</a>
        </p>

        <hr style="margin-bottom: 1.5rem;"> <!-- 中间分隔线 -->

        <nav class="footer-nav" style="text-align: center; margin-bottom: 2rem;"> <!-- 底部文本导航 -->
           <a href="{{ '/' | relative_url }}">首页</a> |
           <a href="{{ '/blog/' | relative_url }}">博客</a> |
           <a href="{{ '/about/' | relative_url }}">关于</a> |
           <a href="{{ '/contact/' | relative_url }}">联系我们</a>
        </nav>

        <!-- ======================================================= -->
        <!-- ===== ^ ^ ^  最新博客文章 & 底部导航 结束 ^ ^ ^ ===== -->
        <!-- ======================================================= -->

      </main> <!-- 主要内容区域结束 -->

      <!-- 页脚 (footer) 内容 -->
      <footer class="site-footer">
        {% if site.github.is_project_page %}
          <span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
        {% endif %}
        <span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
      </footer>

    </div> <!-- wrapper 结束 -->

    <!-- 移除旧的 Google Analytics 占位符 (如果存在) -->
    <!-- {% if site.google_analytics %} <script> /* ... */ </script> {% endif %} -->

  </body>
</html>
